<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class pulpstrength extends CI_Controller 
	{
			public function worklist()
			{
			echo  $this->pulpstrength_model->getWorklist();
			}
			public function getDataPulpStrength()
			{
			 	$inputData = array(
					"form_id"=>"5",
					"type_of"=>$this->input->post("pulpstrengthPS1"),
					"gram"=>$this->input->post("pulpstrengthPS2"),
					"pulp"=>$this->input->post("pulpstrengthPS3"),
					"brand"=>$this->input->post("pulpstrengthPS4")
				);
			 	$text = "";
			 	$inputAllData=array();
			 	for($i=11;$i<=34;$i++){
				$data= array();
				$data = array(
			 	"data_name"=> "pulpstrengthPS".$i,
			 	"data_value"=> $this->input->post("pulpstrengthPS".$i."_1"),
			 	//"value_end"=> $this->input->post("finalcheckFC".$i."_2")
			 	);
			 	$inputAllData[]=$data;
			 	}
				//print_r($inputAllData);
				print_r( $this->pulpstrength_model->keyInPulpStrength($inputData,$inputAllData));
				//echo $this->finalcheck_model->checkFinalCheck($inputData,$inputAllData);

			}
			public function newDataPulpStrength()
			{
			 	$inputData = array(
					"form_id"=>"5",
					"type_of"=>$this->input->post("pulpstrengthPS1"),
					"gram"=>$this->input->post("pulpstrengthPS2"),
					"pulp"=>$this->input->post("pulpstrengthPS3"),
					"brand"=>$this->input->post("pulpstrengthPS4"),
					"start_date"=>$this->input->post("pulpstrengthPS5"),
					"end_date"=>$this->input->post("pulpstrengthPS6"),
					"modify_user"=>$this->session->userdata('user_id'),
					"status"=> '1'
				);
			 	$text = "";
			 	$inputAllData=array();
			 	for($i=11;$i<=34;$i++){
				$data= array();
				$data = array(
			 	"data_name"=> "pulpstrengthPS".$i,
			 	"value_start"=> $this->input->post("pulpstrengthPS".$i."_1"),
			 	"value_end"=> $this->input->post("pulpstrengthPS".$i."_2")
			 	);
			 	$inputAllData[]=$data;
			 	}
				//print_r ($inputAllData);
				echo $this->pulpstrength_model->checkPulpStrength($inputData,$inputAllData);

			}
		public function detail_pulpstrength()
		{
			$t_id = $this->uri->segment(3);
			$data['rs1']=$this->pulpstrength_model->detail_pulpstrength1($t_id);
			$data['rs2']=$this->pulpstrength_model->detail_pulpstrength2($t_id);
			//print_r ($data['rs1']);
			$this->load->view('template/template');
			$this->load->view("detail/RM-PulpStrength",$data);
			$this->load->view('template/footer');
		}
		public function information_pulpstrength()
		{
			$mt_id = $this->uri->segment(3);
			$data['rs1']=$this->pulpstrength_model->information_pulpstrength1($mt_id);
			$data['rs2']=$this->pulpstrength_model->information_pulpstrength2($mt_id);
			//print_r ($data['rs2']);
			$this->load->view('template/template');
			$this->load->view("information/RM-PulpStrength",$data);
			$this->load->view('template/footer');
		}
	}
